/**
 * Created by kenz on 2018/4/13.
 */

import thunkMiddleware from 'redux-thunk'
import { createStore, applyMiddleware } from 'redux'
import rootReducers from '../reducers'
import createLogger from 'redux-logger'

const loggerMiddleware = createLogger

export default function configureStore(initialState) {
  const store = createStore(
    rootReducers,
    initialState,
    applyMiddleware(
      thunkMiddleware,
      loggerMiddleware
    )
  )
  return store
}